export const importConfig = {
	tabSteps: [
		{
			label: '下载模板',
			download: '下载模板',
			active: 1,
			rules: [
				{
					label: '下载最新导入模板。共1个：',
					children: [
						{
							label: '《设备管理模板》',
							link: true,
							url: 'view_dpEquipmentManagement_downloadTemplate',
						},
					],
				},
			],
		},
		{
			label: '导入信息',
			description: '',
			uploadTip: '设备管理',
			active: 2,
			url: 'view_dpEquipmentManagement_import',
			code: 3039,
			rules: [
				{
					label: '导入规则说明:',
					children: [
						{
							label: '(1)导入模式为“覆盖导入”，待导入的信息会覆盖平台已存在的',
						},
					],
				},
			],
		},
	],
	dataType: 90,
}

export const formConfig = {
	inline: false,
	showBtn: true,
	labelPosition: 'top',
	column: [
		{
			label: '设备图片',
			prop: 'equipmentPhoto',
			type: 'upload',
			labelPosition: 'top',
			showFileList: false,
			limit: 1,
			multiple: false,
			custome: 'img',
			rules: [{ required: true, message: '请上传照片' }],
			span: 24,
		},
		{
			label: '养老机构统一信用代码',
			prop: 'creditCode',
			maxlength: '18',
			showWordLimit: true,
			type: 'text',
			span: 8,
			labelPosition: 'top',
		},
		{
			label: '养老机构名称',
			prop: 'organizationName',
			maxlength: '50',
			showWordLimit: true,
			type: 'text',
			labelPosition: 'top',
			span: 8,
		},

		{
			label: '设备编号',
			prop: 'equipmentNumber',
			type: 'input',
			span: 8,
		},
		{
			label: '设备名称',
			prop: 'equipmentName',
			type: 'text',
			span: 8,
		},
		{
			label: '设备位置',
			prop: 'equipmentLocation',
			type: 'input',
			span: 8,
		},
		{
			label: '设备类型',
			prop: 'equipmentType',
			type: 'input',
			span: 8,
		},
		{
			label: '设备状态说明',
			prop: 'equipmentStatusIntroduction',
			type: 'input',
			span: 8,
		},
		{
			label: '设备有效期',
			prop: 'equipmentValidityPeriod',
			type: 'date',
			format: 'YYYY年MM月DD',
			valueFormat: 'YYYY-MM-DD HH:mm:ss',
			span: 8,
		},
	],
}

export const searchConfig = {
	inline: true,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '养老机构名称',
			prop: 'organizationName',
			type: 'text',
			span: 8,
		},
		{
			label: '养老机构统一信用代码',
			prop: 'creditCode',
			maxlength: '18',
			showWordLimit: true,
			type: 'text',
			span: 8,
		},
		{
			label: '设备编号',
			prop: 'equipmentNumber',
			type: 'input',
			span: 8,
		},
		{
			label: '设备名称',
			prop: 'equipmentName',
			type: 'text',
			span: 8,
		},
		{
			label: '设备位置',
			prop: 'equipmentLocation',
			type: 'input',
			span: 8,
		},
		{
			label: '设备类型',
			prop: 'equipmentType',
			type: 'input',
			span: 8,
		},
	],
}

export const tableConfig = {
	stripe: true,
	border: true,
	columns: [
		{ label: '养老机构名称', prop: 'organizationName' },
		{ label: '设备编号', prop: 'equipmentNumber' },
		{ label: '设备名称', prop: 'equipmentName' },
		{ label: '设备位置', prop: 'equipmentLocation' },
		{ label: '设备类型', prop: 'equipmentType' },
		{ label: '设备图片', prop: 'equipmentPhoto', custome: 'file' },
		{ label: '设备状态说明', prop: 'equipmentStatusIntroduction' },
		{ label: '设备有效期', prop: 'equipmentValidityPeriod' },
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

export const api = {
	index: 'view_dpEquipmentManagement_page',
	add: 'view_dpEquipmentManagement_add',
	edit: 'view_dpEquipmentManagement_edit',
	delete: 'view_dpEquipmentManagement_del',
	import: 'view_dpEquipmentManagement_import',
	export: 'view_dpEquipmentManagement_export',
}
export const baseConfig = {
	pageName: '设备管理',
	dictcodes: ['CHECKOUT_REASON'],
	rowKey: 'id',
	addLabel: '新增',
	tipLabel: 'organizationName',
	exportMqTopic: '/ning/export/',
	paramsObj: {
		code: 3039,
	},
	api,
	auth: {
		index: 'view_dpEquipmentManagement_page',
		add: 'view_dpEquipmentManagement_add',
		edit: 'view_dpEquipmentManagement_edit',
		delete: 'view_dpEquipmentManagement_del',
		import: 'view_dpEquipmentManagement_import',
		export: 'view_dpEquipmentManagement_export',
		mulitSet: 'mulitSet',
	},
	menuBtn: [
		{
			icon: 'editor',
			label: '编辑',
			type: 'primary',
			operate: 'edit',
			auth: 'view_dpEquipmentManagement_edit',
			text: true,
			show: true,
		},
		{
			icon: 'detail',
			label: '查看详情',
			type: 'primary',
			operate: 'detail',
			auth: 'view_dpEquipmentManagement_page',
			text: true,
			show: true,
		},
		{
			icon: 'delete',
			label: '删除',
			type: 'danger',
			operate: 'delete',
			auth: 'view_dpEquipmentManagement_del',
			text: true,
			show: true,
		},
	],

	saveFormate: async (form) => {
		return new Promise((resolve, reject) => {
			resolve(form)
		})
	},
	dialogConfig: {
		width: '75%',
	},
	searchConfig,
	formConfig,
	tableConfig,
	importConfig,
	detailConfig: formConfig,
}
